<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>首页</title>
  <style>
    *,
    *::after,
    *::before {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    :root {
      min-height: 100vh;
    }

    :root:focus-within {
      scroll-behavior: smooth;
    }

    body {
      min-height: inherit;
    }
  </style>
</head>

<body>
  <div></div>
</body>
<script>
  "use strict"; {
    /* 
    <scroll-view class="scrollView" :style='{height:_height +"px"}' scroll-y="true" enable-back-to-top="true">
    </scroll-view>

    onReady() {
      uni.getSystemInfo({
        success: res => {
          let wh = res.windowHeight;
          // //想要获取高度的元素名（class/id）
          uni.createSelectorQuery()
            .select(".scrollView")
            .boundingClientRect(({ top }) => {
              //计算高度：元素高度=窗口高度-元素距离顶部的距离（data.top）
              this._height = wh - top;
              console.log(`wh, top, h==`, this._height, wh, top);
            }).exec();
        },
        fail(err) {
          console.error(err);
        }
      })
    },
    */
  };
</script>

</html>